package ControlLayer;
import ModelLayer.Profile;
import DBLayer.DBProfile;
import java.util.ArrayList;

public class CtrProfile {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrProfile instance = null;
    DBProfile dbProfile = new DBProfile();

    public CtrProfile() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrProfile getInstance() {
        if (instance == null) {
            instance = new CtrProfile();
        }
        return instance;
    }

    public ArrayList<Profile> getProfileList() {
        return dbProfile.getProfileList();
    }

    public Profile getProfileByID(int id) {
        return dbProfile.getProfileByID(id);
    }

    public int addProfile(Profile profile) {
        return dbProfile.addProfile(profile);
    }

    public int updateProfile(Profile profile, int id) {
        return dbProfile.updateProfile(profile, id);
    }

    public void deleteProfile(int id) {
        dbProfile.deleteProfile(id);
    }
    // </editor-fold>
}
